import Main from '@/view/main'
import parentView from '@/components/parent-view'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */

export default [
  { path: '/login', name: 'login', meta: { title: 'Login - 登录', hideInMenu: true }, component: () => import('@/view/login/login.vue') },
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true
    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          hideInMenu: true,
          title: '首页',
          notCache: true
        },
        component: () => import('@/view/single-page/home')
      }
    ]
  },

  {
    path: '/adminSys',
    name: 'adminSys',
    meta: {
      icon: '_xitongguanli',
      showAlways: true,
      title: '权限管理系统'
    },
    component: Main,
    children: [
      {
        path: 'baseManager',
        name: 'baseManager',
        meta: {
          access: ['baseManager'],
          icon: '_yonghuguanli',
          showAlways: true,
          title: '基础配置管理'
        },
        component: parentView,
        children: [
          { path: 'myAccount', name: 'myAccount', meta: { icon: '_yonghuguanli', title: '我的账户', access: ['myAccount'] }, component: () => import('@/view/admin/myAccount/index.vue') },
          { path: 'userManager', name: 'userManager', meta: { icon: '_yonghuguanli', title: '用户管理', access: ['userManager'] }, component: () => import('@/view/admin/user/index.vue') },
          { path: 'menuManager', name: 'menuManager', meta: { icon: '_caidanguanli', title: '菜单管理', access: ['menuManager'] }, component: () => import('@/view/admin/menu/index.vue') },
          { path: 'groupManager', name: 'groupManager', meta: { icon: '_jiaoseguanli', title: '角色权限管理', access: ['groupManager'] }, component: () => import('@/view/admin/group/index.vue') },
          { path: 'groupTypeManager', name: 'groupTypeManager', meta: { icon: '_jiaoseguanli', title: '角色类型管理', access: ['groupTypeManager'] }, component: () => import('@/view/admin/groupType/index.vue') },
          { path: 'dictManager', name: 'dictManager', meta: { icon: '_zidianguanli', title: '数据字典', access: ['dictManager'] }, component: () => import('@/view/multilevel/level-2-2/level-3-1.vue') },
          { path: 'gateLogManager', name: 'gateLogManager', meta: { icon: '_rizhiguanli', title: '操作日志', access: ['gateLogManager'] }, component: () => import('@/view/admin/gateLog/index.vue') },
          { path: 'tenantManager', name: 'tenantManager', meta: { icon: '_zuhuguanli', title: '租户管理', access: ['tenantManager'] }, component: () => import('@/view/admin/tenant/index.vue') },
          { path: 'applicationManager', name: 'applicationManager', meta: { icon: '_zuhuguanli', title: '应用管理', access: ['applicationManager'] }, component: () => import('@/view/admin/application/index.vue') },
          { path: 'appOrderManager', name: 'appOrderManager', meta: { icon: 'ios-list-box', title: '账户订单管理', access: ['appOrderManager'] }, component: () => import('@/view/admin/appOrder/index.vue') },
          { path: 'jobManager', name: 'jobManager', meta: { icon: '_guiji', title: '定时作业管理', access: ['jobManager'] }, component: () => import('@/view/multilevel/level-2-2/level-3-1.vue') }
        ]
      },
      {
        path: 'orgManager',
        name: 'orgManager',
        meta: {
          icon: '_bumenguanli',
          title: '组织部门管理',
          access: ['departManager'],
          showAlways: true
        },
        component: parentView,
        children: [
          {
            path: 'departManager',
            name: 'departManager',
            meta: {
              icon: 'md-funnel',
              title: '部门管理'
            },
            component: () => import('@/view/admin/depart/index.vue')
          }
        ]
      },
      {
        path: 'authManager',
        name: 'authManager',
        meta: {
          icon: '_bumenguanli',
          title: '服务管理',
          access: ['authManager'],
          showAlways: true
        },
        component: parentView,
        children: [
          { path: 'serviceManager', name: 'serviceManager', meta: { icon: '_guiji', title: '服务权限管理', access: ['serviceManager'] }, component: () => import('@/view/auth/service/index.vue') },
          { path: 'apiManager', name: 'apiManager', meta: { icon: '_guiji', title: '服务接口文档', access: ['apiManager'] }, component: () => import('@/view/auth/api/index.vue') },
          { path: 'gatewayManager', name: 'gatewayManager', meta: { icon: '_guiji', title: '网关路由管理', access: ['gatewayManager'] }, component: () => import('@/view/auth/gatewayRoute/index.vue') },
          { path: 'oauthClientDetailsManager', name: 'oauthClientDetailsManager', meta: { icon: '_guiji', title: '客户端管理', access: ['oauthClientDetailsManager'] }, component: () => import('@/view/auth/oauthClientDetails/index.vue') }
        ]
      },
      {
        path: 'monitorManager',
        name: 'monitorManager',
        meta: {
          icon: '_bumenguanli',
          title: '监控运维管理',
          access: ['monitorManager'],
          showAlways: true
        },
        component: parentView,
        children: [
          { path: 'serviceEurekaManager', name: 'serviceEurekaManager', meta: { icon: '_guiji', title: '服务注册管理', access: ['serviceEurekaManager'] }, component: () => import('@/view/multilevel/level-2-2/level-3-1.vue') },
          { path: 'serviceMonitorManager', name: 'serviceMonitorManager', meta: { icon: '_guiji', title: '服务监控管理', access: ['serviceMonitorManager'] }, component: () => import('@/view/multilevel/level-2-2/level-3-1.vue') },
          { path: 'serviceZipkinManager', name: 'serviceZipkinManager', meta: { icon: '_guiji', title: '服务链路监控', access: ['serviceZipkinManager'] }, component: () => import('@/view/monitor/zipkin/index.vue') }
        ]
      }
    ]
  },

  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
]
